Ban embedded images wider than my monitor

  • Suggestion
  • Thread starter NeoDevin
  • Start date
In summary: Image) > $maxWidth || imagesy($thisImage) > $maxHeight){$aspectRatio = imagesx($thisImage)/imagesy($thisImage);$newWidth = $aspectRatio*$maxHeight;$newHeight = $maxHeight;if ($newWidth > $maxWidth){$newWidth = $maxWidth;$newHeight = $newWidth/$aspectRatio;}$thisImage = imagecopyresized($thisImage, $newWidth, $newHeight, 0, 0, imagesx($thisImage), imagesy($thisImage));}How hard would it be to make the rest of the posts in the thread behave normally, and have only the posts with larger images/long
  • #1
NeoDevin
334
2
Or at least make it so they only stretch the post they are in, rather than the entire thread. It becomes a nuisance to read threads with large images in them when I have to scroll over to read the text on every single post. There must be a way to force all the text in the thread to wrap normally, even when there's a large image present.
 
Physics news on Phys.org
  • #2


Yes, we should ban everyone from doing something so you don't have to find a solution. o_O
 
  • #3


Wide images break the forum. Yes, one can work around the break, but it's still broken nonetheless. It (along with 1000 character "words") deserves at least a warning for obnoxious behavior.
 
  • #4


Maybe the server could autoresize the images when above some limit?
 
  • #5


How hard would it be to make the rest of the posts in the thread behave normally, and have only the posts with larger images/longer words extended?
 
  • #6


NeoDevin said:
How hard would it be to make the rest of the posts in the thread behave normally, and have only the posts with larger images/longer words extended?

I'm thinking it may well be difficult, because I've not yet been a participant on a message board that didn't get all screwed up, width-wise, as a result of really large images.

I'm onside with the OP's annoyance. When someone posts a picture that stretches thread-width so I have to scroll side-to-side to read, then I either just advance to the next page or give up on the thread entirely. It's too much of a pain in the butt to try and continue.

Maybe just a restriction on the size of photos that can be posted could be the easiest way to go? I know I'd love to do that with my board and have no clue how.
 
  • #7


NeoDevin said:
How hard would it be to make the rest of the posts in the thread behave normally, and have only the posts with larger images/longer words extended?

It's a lot of work. And no one qualified (or at least, inclined) to do it.

Autoresizing all images to have a max width is the better solution.
 
  • #8


NeoDevin said:
How hard would it be to make the rest of the posts in the thread behave normally, and have only the posts with larger images/longer words extended?
That would actually be difficult, since the threads are laid out using HTML tables and browsers don't support making one row of a table wider than the others. But I think the problem could be solved with the CSS overflow property.
Code:
td.alt1 {max-width: 700px}
td.alt1 > div {overflow: auto}
fixes it for me on FF 3.6. It puts a scrollbar on the post whenever the content is wider than the screen.

Or if you didn't want to rely on what appears to be a strange quirk in Firefox, the max-width could be set by a bit of Javascript.
 
  • #9


Get wider eyes.
 
  • #10


DaveC426913 said:
It's a lot of work. And no one qualified (or at least, inclined) to do it.

Autoresizing all images to have a max width is the better solution.
Unless Greg can find a way, resizing means that I have to copy the picture to my hard drive, then upload it to my personal image account and resize it, then replace the oversized image. Keeping the link to my personal account.

No.

If you guys would like me to delete all oversized photos, say so here and I will delete them.
 
  • #11
Oversized photos could be linked to instead of embedded. Could greg make a button for mentors to automatically replace them with links?
 
  • #12


Two more comments:

1) In PF Mobile, images are automagically resized to fit.

2) Could a mentor please fix the spelling of 'embedded' in the thread title, it's driving me nuts.
 
  • #13


NeoDevin said:
Two more comments:

1) In PF Mobile, images are automagically resized to fit.

That is likely a feature of whatever mobile browser you are using.
 
  • #14


NeoDevin said:
Oversized photos could be linked to instead of embedded. Could greg make a button for mentors to automatically replace them with links?

That's what I do whenever I find an image that is too big for the screen: edit the post to remove the image tags and leave the url. Just report the next wide image you see, and we can do this.
 
  • #15
NeoDevin said:
Or at least make it so they only stretch the post they are in, rather than the entire thread. It becomes a nuisance to read threads with large images in them when I have to scroll over to read the text on every single post. There must be a way to force all the text in the thread to wrap normally, even when there's a large image present.

yeah, right. Personally, I would like to see the software first check the size of it, and if it's too large, then pass the image to some application which cuts it down to a reasonable single-screen image of the picture but yet, still give the user an option to override this feature if they have privs and say so.
 
Last edited:
  • #16


Evo said:
Unless Greg can find a way, resizing means that I have to copy the picture to my hard drive, then upload it to my personal image account and resize it, then replace the oversized image. Keeping the link to my personal account.
What? No.

I don't mean literally resaving the image, I mean simply displying it at a limited size.
All you need so is set width="x" in the image tag if the image's width is > x.
 
  • #17


DaveC426913 said:
What? No.

I don't mean literally resaving the image, I mean simply displying it at a limited size.
All you need so is set width="x" in the image tag if the image's width is > x.

I'm pretty sure you can't do that with the forum img tags.
 
  • #18


cristo said:
I'm pretty sure you can't do that with the forum img tags.

Of course you can.


It's just a bit of custom code.
Code:
<script>
    if (document.thisImage.width > maxWidth){
        document.write("<img width='" + maxWidth + "'/>")
    }
    else{
        document.write("<img/>")
    }
</script>
Or the PHP equivalent.
 
  • #19
test:

URL]
 
Last edited by a moderator:
  • #20
cristo said:
test:

[PLAIN]http://www.mooseyscountrygarden.com/autumn-leaves/red-maple-tree.jpg[/QUOTE][/PLAIN]



You jest.

It's a Greg thing.
 
Last edited by a moderator:
  • #21


DaveC426913 said:
Or the PHP equivalent.

Forum image tags aren't html. I'm sure this thing came up ages ago, someone suggested to "simply" use a width command, but it doesn't work.

Anyway, it's hardly an issue: if an image does not fit to the width of the screen, then the tags can be removed leaving the url.
 
  • #23


D H said:
Here is the url to an 800x600 image: http://upload.wikimedia.org/wikiped...ve.JPG/800px-Nephila_clavipes_perspective.JPG

Please show how to display this as a 400x300 image.

I think we're missing each others' point here. This is not user-side fix; it's a programming fix.

Greg would insert a line into the forum code (PHP, IIRC) that, any time it goes to display an image larger than acceptable, it simply writes an extra bit of code to define a width. User has no choice in the matter.
 
  • #24
I can be missing something, but wouldn't that mean that server - before generating HTML - would have to fetch the image from wherever it is hosted? That would require crazy bandwidth.
 
  • #25
Borek said:
I can be missing something, but wouldn't that mean that server - before generating HTML - would have to fetch the image from wherever it is hosted? That would require crazy bandwidth.
Yes. I think it's already been tryed.

http://www.vbulletin.org/forum/showthread.php?t=53433
 
  • #26
Borek said:
I can be missing something, but wouldn't that mean that server - before generating HTML - would have to fetch the image from wherever it is hosted? That would require crazy bandwidth.

I see your point.
 
  • #27
Borek said:
I can be missing something, but wouldn't that mean that server - before generating HTML - would have to fetch the image from wherever it is hosted? That would require crazy bandwidth.
Yes of course, missed that. If the image is touched, it needs to be user side only.
 
  • #28
I'd suggest asking mentors to replace the huge image with a link and asking the member to resize it before re-posting.
 
  • #29
Sorry if I'm being an idiot here but I just saw this thread. There's a modification available I believe from vBulletin, though if not then there is definitely one from the vBulletin community somewhere because I've used it personally and I've seen different types of mods used on different forums.

I guess it depends on how much effort whoever is in charge wants to put in, but you could always argue that it's much more fun to ban the jerks... >:)
 
  • #31
Here is where I wrote a rough draft of some guidelines or instructions for new users, for posting an attachment. If any admin or mentor wants to use any of my wording (if any is usable), feel free.

nvn to new user: Did you know you can https://www.physicsforums.com/showthread.php?t=433015#post2906520" a diagram when you post? You could scan (or photograph) a freehand sketch, or draw a rough diagram using Start > Programs > Accessories > Paint, if you wish.

new user: I took some pics of my sketch, but the file is too big to upload [to PF].

nvn: Try going to the link I posted, above, then click the imageshack link, then upload your pictures. I think you can use the "image resize" pull-down menu in imageshack, if you wish; but it is perhaps not required. Then post direct links to the pictures.​

Five minutes later, the new user posted plain text links to the images. So the learning curve is only five minutes. And in this way, the text links to the images do not ruin the thread.
 
Last edited by a moderator:

Related to Ban embedded images wider than my monitor

1. What does it mean to "ban embedded images wider than my monitor"?

When a website or online platform has a rule or feature in place to "ban embedded images wider than my monitor," it means that any images that are wider than the user's screen or monitor will not be displayed. This is often done to improve the user experience and prevent images from appearing distorted or cut off.

2. Why is it important to ban embedded images wider than my monitor?

It is important to ban embedded images wider than the monitor because it can negatively impact the user experience. Images that are too wide can appear stretched or pixelated, making them difficult to view or understand. This can also affect the overall design and layout of a website, making it look unprofessional or messy.

3. How does a website or platform determine if an image is wider than my monitor?

A website or platform can determine if an image is wider than the user's monitor by using the dimensions of the image and comparing it to the screen resolution of the user's device. If the image is wider than the screen resolution, it will be banned or resized to fit within the screen.

4. Can I still view wider images if they are not banned?

Yes, you can still view wider images if they are not banned. However, they may appear distorted or cut off, making them difficult to view or understand. It is recommended to resize or crop images to fit within the screen resolution to ensure a better user experience.

5. Are there any exceptions to banning embedded images wider than my monitor?

Yes, there may be exceptions to banning wider images, depending on the website or platform's rules and settings. Some may allow users to zoom in or out on images to view them in their entirety, while others may have a feature to expand the image to fit within the screen. It is best to check the website's guidelines or contact the platform's support team for more information.

Similar threads

  • Feedback and Announcements
Replies
5
Views
841
  • Astronomy and Astrophysics
2
Replies
43
Views
10K
  • General Discussion
Replies
10
Views
1K
Replies
23
Views
2K
Replies
17
Views
2K
Replies
11
Views
1K
  • General Discussion
Replies
24
Views
2K
  • General Discussion
Replies
15
Views
2K
  • General Discussion
Replies
18
Views
2K
Back
Top